/**
 * Decription of the code to go here *****************************
 *
 * Group name/code:
 *      Matthew Brews
 *      Stephen Gore
 *      Steven Hartin
 *
 *
 * =============================================================================
 * Date       Programmer    Amendments made & justification (if needed)
 * =============================================================================
 * 02.03.12   Steven        Added timer and repeat classed.
 * -----------------------------------------------------------------------------
 * 01.03.12   Steven        Added input, keyboard, mouse, inputdevicemanager
 *                          from a previous project.
 *
 *                          Created filewriter and filereader classes.
 * -----------------------------------------------------------------------------
 * 29.02.12   Steven        Finished first basic class diagram structure
 *            Stephen 
 *            Matthew
 * -----------------------------------------------------------------------------
 * 25.02.12   Stephen       Declared the header for the camera class and a 
 *                          constants header
 *                          Defined the material, light, light container and
 *                          camera class
 * -----------------------------------------------------------------------------
 * 24.02.12   Stephen       Created the header files for the material, light and
 *                          light container class
 * -----------------------------------------------------------------------------
 * 23.02.12   Stephen            
 *            Steven        Started class diagrams      
 *            Matthew k                
 * -----------------------------------------------------------------------------
 */

#if defined(DEBUG) | defined(_DEBUG)
    /*#define CRTDBG_MAP_ALLOC
    #include <crtdbg.h>
    #include <stdlib.h>*/
    #define new_ new(_NORMAL_BLOCK, __FILE__, __LINE__)
#else
    #define  new_ new
#endif

#include <Windows.h>

#include "resource.h"
#include "application.h" 

int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPreviousInst, 
                   LPSTR szArgv, int nCmdShow)
{
    /**
     * Default entry point for windows GUI application.
     *
     * @param HINSTANCE hInst The handle to the instance of this application.
     * @param HINSTANCE hPreviousInst Always null, any previous instance.
     * @param LPSTR szArgv The command line arguments passed to the program
     * @param int nCmdShow The state of how to show the window.
     */

#ifdef _DEBUG
    //_CrtSetBreakAlloc(162);
#endif

    CApplication *pApplication(CApplication::getInstance());
    if (pApplication->initialise(hInst))
    {
        pApplication->gameLoop();
    }

#ifdef _DEBUG
    /*_CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
    _CrtSetReportMode( _CRT_ERROR, _CRTDBG_MODE_DEBUG );
    _CrtDumpMemoryLeaks();*/
#endif

    return 0;
}